<template>
    <el-select
        v-model="selectedVal"
        clearable
        filterable
        class="filter-item"
        placeholder="任务类型"
        style="width: 150px;">
        <el-option :label="`${item.value}) ${item.label}`" :value="item.value" v-for="(item, index) in kinds" :key="index"></el-option>
    </el-select>
</template>

<script>
    export default {
        // name: "source",
        props: ['value'],
        data () {
            return {
                selectedVal: '',
                kinds: this.$store.state.activity.options.kinds,
            };
        },
        watch: {
            value() {
                this.syncForm();
            },
            selectedVal() {
                this.$emit('input', this.selectedVal);
            }
        },
        methods: {
            syncForm() {
                this.selectedVal = this.value;
            },
        },
        created() {
            this.syncForm();
        }
    }
</script>

<style scoped>

</style>
